<?php

namespace Common\Model;
use Think\Model;

class OrderModel extends Model{

	protected $trueTableName = 'tb_order';

    public function _getWhere($map) 
	{
        $where = array();
        /*
		empty($map['name']) ?: $where['name'] = array('like', '%' . $map['name'] . '%');
        empty($map['title']) ?: $where['title'] = array('like', '%' . $map['title'] . '%');
        empty($map['number']) ?: $where['number'] = $map['number'];
        empty($map['st']) ?  : $where["status"] = $map['st'];
		*/
        return $where;
    }
	
	public function getDataNum($map) 
	{
        $where = $this->_getWhere($map);
        $count = $this->where($where)->count();
        return $count;
    }

    public function getOneData($id)
    {
        $oneData = $this->where('id =' . $id)->find();
        return $oneData;
    }
	
}
	
?>